﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using SongSharp.Domain.Objects;
using SongSharp.Presentation.Properties;

namespace SongSharp.Presentation.ViewModel.Data
{
    public class PlaylistViewData
    {
        public Playlist PlaylistObject { get; private set; }
        public string IconURL { get; set; }
        public string NameShortened
        {
            get
            {
                if (PlaylistObject.Name.Length > Settings.Default.PlaylistNameLength)
                    return PlaylistObject.Name.Substring(0, Settings.Default.PlaylistNameLength) + "...";
                return PlaylistObject.Name;
            }
        }

        public PlaylistViewData(Playlist playlist)
        {
            PlaylistObject = playlist;
            IconURL = Settings.Default.PlaylistIconGrey;
        }

        public PlaylistViewData(Playlist playlist, string iconURL)
        {
            PlaylistObject = playlist;
            IconURL = iconURL;
        }

        public override string ToString()
        {
            return PlaylistObject.Name;
        }
    }
}
